<?php
define("APPLICATION_PATH",  realpath(dirname(__FILE__) . '/../'));
define("APPLICATION_COINFIG_FILE",APPLICATION_PATH . "/conf/application.ini");

define("SERVER_NAME", $_SERVER['SERVER_NAME']);
define("SERVER_DOMAIN_HTTPS", 'https://' . SERVER_NAME);
define("AVATAR", 'avatar.png');
define("SOCKET_PORT", '10203');
define('QINIU_DOMAIN', 'https://qnssl.touhaoshiwan.com/');
define("WEIXIN_SHARE_LINK", 'http://wx.th502.cn/?id=');
define("WEIXIN_QRCODE_LINK", 'http://wx.th502.cn/?id=');


define("SHIWAN_ENC_KEY", '04i4kaflammcmc89kd');
define("SHIWAN_KEY", '3akkkadifoecllpaf1');
define("SHIWAN_ENC_KEY_APPLY", '930924adfklaksldfoiasdf');
define("SHIWAN_KEY_APPLY", 'eo3o2i24infioaoifoioererr');

define("DEFAULT_AVATAR", QINIU_DOMAIN . 'default_avatar.png');
define("SHARE_LOGO", "default_avatar.png");

if((isset($_SERVER['REQUEST_SCHEME']) && $_SERVER['REQUEST_SCHEME'] == 'https') 
|| (isset($_SERVER['HTTP_X_FORWARDED_PROTO']) && $_SERVER['HTTP_X_FORWARDED_PROTO'] == 'https')){
    define("SERVER_DOMAIN", 'https://' . SERVER_NAME);
} else {
    define("SERVER_DOMAIN", 'http://' . SERVER_NAME);
}

date_default_timezone_set('Asia/Shanghai');
$app  = new Yaf_Application(APPLICATION_COINFIG_FILE);
$app->bootstrap()->run();